"""
页面的前进和后退
"""
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.maximize_window()
driver.get("http://news.baidu.com")
driver.find_element(By.CSS_SELECTOR, "a[href='//help.baidu.com']").click()
time.sleep(3)
driver.back()
time.sleep(2)
driver.forward()
time.sleep(2)
driver.close()
